package myky.com.doctorapp.ui

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager
import com.foamtrace.photopicker.Image
import com.foamtrace.photopicker.ImageCaptureManager
import com.gyf.barlibrary.ImmersionBar
import kotlinx.android.synthetic.main.activity_image_list.*
import kotlinx.android.synthetic.main.activity_remote_details.*
import kotlinx.android.synthetic.main.public_common_title.*

import myky.com.doctorapp.R
import myky.com.doctorapp.adapter.ImageAdapter
import myky.com.doctorapp.adapter.RemoteStatusAdapter
import myky.com.doctorapp.entity.ImageEntity
import myky.com.doctorapp.utils.Constants

/**
 * Description: 远程详情查看更多图片集合
 * @author wuyang
 * Created by 2019/3/13 15:38
 */
class ImageListActivity : AppCompatActivity() {

    lateinit var imageAdapter:ImageAdapter
    lateinit var imageList:List<ImageEntity>
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_image_list)
        ImmersionBar.with(this)
                .statusBarColor(R.color.colorPrimary)
                .titleBar(R.id.activity_image_list_title)
                .init()
        conmonTitleTextView.text = getText(R.string.remote_supply_images)
        var bundle = intent.extras
        imageList = bundle.getSerializable(Constants.IMAGELIST) as List<ImageEntity>
        imageAdapter= ImageAdapter(imageList)
        activity_image_list_recycler.layoutManager = GridLayoutManager(this, 3)
        activity_image_list_recycler.adapter=imageAdapter
        backLayout.setOnClickListener {
            finish()
        }
    }
}
